import { requestHandler } from '@/utils/rquest';
import { IArcticle, IArcticleList, INotArticle, IArcticleDetails } from '@/interface/IArticle'
import { IPages } from '@/interface/pages';
const prefix = "/article";
/**
 * 精彩内容
 */
export const excitingContentApi = () => requestHandler<IArcticle[]>("GET", prefix + "/exciting");


/**
 * 推荐专区
 */
export const recommendedZoneApi = () => requestHandler<IArcticle[]>("GET", prefix + "/recommended");


/**
 * 热门回答
 */
export const notAnswerApi = () => requestHandler<INotArticle[]>("GET", prefix + "/not");

/**
 * 问答分页
 * @param type 类型
 * @param current 第几页 
 * @param size 一次搜索几条
 * @returns 
 */
export const AnswerPagesApi = (type: string, current: number = 1, size: number = 10) => requestHandler<IPages<IArcticleList[]>>("GET", prefix + `/${type}/page/${current}/${size}`);


/**
 * 文章详情
 */
export const AnswerDetailsApi = (id: string) => requestHandler<IArcticleDetails>("GET", prefix + `/${id}/details/`);

